#!/bin/sh

if [ $# -ne 1 ]; then
	dateStr=`date "-d 1 days ago" +%Y-%m-%d`
else
	dateStr=`date "-d $1 days ago" +%Y-%m-%d`
fi
echo $dateStr

expect -c "spawn /usr/local/bin/scp padcgilog@10.133.4.164:/data/java/logs/cgi-android/msg-tomcat*.log.${dateStr} /data/java/logs/cgi-android164/; set timeout 300; expect \"password:\"; send -- \"shiangzhang\r\"; expect eof;"

expect -c "spawn /usr/local/bin/scp padcgilog@10.134.131.213:/data/java/logs/cgi-android/msg-tomcat*.log.${dateStr} /data/java/logs/cgi-android213/; set timeout 300; expect \"password:\"; send -- \"shiangzhang\r\"; expect eof;"
